package com.ruoyi.system.service.impl;

import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.dto.CustomersDto;
import com.ruoyi.common.core.domain.dto.ProgressDto;
import com.ruoyi.common.core.domain.entity.CustomerProgress;
import com.ruoyi.common.core.domain.entity.Customers;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.CacheUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.SysConfig;
import com.ruoyi.system.mapper.CustomersMapper;
import com.ruoyi.system.mapper.SysConfigMapper;
import com.ruoyi.system.service.ICustomerService;
import com.ruoyi.system.service.ISysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.List;

/**
 * 参数配置 服务层实现
 * 
 * @author ruoyi
 */
@Service
public class CustomerServiceImpl implements ICustomerService
{
    @Autowired
    private CustomersMapper customersMapper;

    @Override
    public List<Customers> selectAll(CustomersDto customersDto) {
        return customersMapper.selectAll(customersDto);
    }

    @Override
    public Customers selectByPrimaryKey(Long id) {
        return customersMapper.selectByPrimaryKey(id);
    }

    @Override
    public int insert(Customers record) {
        return customersMapper.insert(record);
    }

    @Override
    public int updateByPrimaryKey(Customers record) {
        return customersMapper.updateByPrimaryKey(record);
    }

    @Override
    public void deleteByPrimaryKey(String ids) {
        Long[] dataIds = Convert.toLongArray(ids);
        for (Long dataId : dataIds)
        {
            customersMapper.deleteByPrimaryKey(dataId);
        }
    }

    @Override
    public void updatePlatformProgress(ProgressDto customerProgress) {
        customersMapper.updatePlatformProgress(customerProgress);
    }

    @Override
    public void insertPlatformProgress(ProgressDto customerProgress) {
        customersMapper.insertPlatformProgress(customerProgress);
    }

    @Override
    public List<Customers> getCustomerPlatformsAndProgress(ProgressDto customerProgress) {
        return customersMapper.getCustomerPlatformsAndProgress(customerProgress);
    }
}
